package com.ts.api.common.constant.channel;

import com.ts.api.common.context.ChannelContext;
import com.ts.api.module.channel.entity.po.ChannelPO;

/**
 *  渠道类型枚举
 */
public enum ChannelTypeEnum {

    H5(1),
    APP(2),
    API_V1(3),
    API_V2(4),
    API_V3(5);

    /** 版本号 */
    private final Integer type;

    /**
     * 构造函数
     *
     * @param type
     */
    private ChannelTypeEnum(Integer type) {
        this.type = type;
    }

    public Integer getType() {
        return type;
    }

    public boolean hasType() {
        ChannelPO channelPO = ChannelContext.get();
        return this.getType().equals(channelPO.getType());
    }
}
